import { Sprite } from './Sprite';
import { GAnimation } from './GAnimation';
import { Resources } from './Resources'

//魔法精灵
export class MagicSprite extends Sprite {

    animation: GAnimation;
    constructor() {
        super();
        //初始化动画
        this.animation = new GAnimation(Resources.images, 500);
        //自动循环播放
        this.animation.play();

    }

    //更新函数
    update(timespan: number): void {
        this.animation.update(timespan);
    }

    //动画播放
    draw(canvas: HTMLCanvasElement): void {
        this.animation.draw(canvas);
    }

}